{extend name='admin@public/content'}

{block name="button"}
<button data-open='{:url("$classuri/")}' data-title="返回列表" class='layui-btn layui-btn-sm layui-btn-primary'><i class='fa fa-arrow-left'></i> 返回列表</button>

<!--{if auth("$classuri/add")}-->
<button data-modal='{:url("$classuri/addAd")}?id={$spot.id}' data-title="新建广告" class='layui-btn layui-btn-sm layui-btn-primary'>新建广告</button>
<!--{/if}-->

<!--{if auth("$classuri/del")}-->
<button data-update data-field='delete' data-action='{:url("$classuri/delAd")}' class='layui-btn layui-btn-sm layui-btn-primary'>删除广告</button>
<!--{/if}-->
{/block}

{block name="content"}

<form onsubmit="return false;" data-auto="" method="POST">
    <input type="hidden" value="resort" name="action"/>
    <table class="layui-table notevent" lay-skin="line">
        <thead>
        <tr>
            <th class='list-table-check-td'>
                <input data-none-auto="" data-check-target='.list-check-box' type='checkbox'/>
            </th>
            <th class='list-table-sort-td'>ID</th>
            <th class="w120">广告图片</th>
            <th class="w200">广告位</th>
            <th>名称</th>
            <th>排序</th>
            <!--<th>广告链接</th>-->
            <th class="w150">创建时间</th>
            <th class='text-center w150'>操作</th>
        </tr>
        </thead>
        <tbody>
        {if isset($adv_list) && $adv_list != null}
        {foreach $adv_list as $key=>$vo}
        <tr>
            <td class='list-table-check-td'>
                <input class="list-check-box" value='{$vo.id}' type='checkbox'/>
            </td>
            <td class='list-table-sort-td'>{$vo.id}</td>
            <td>
                <img src="{$vo.image}" style="width: 90px;"/>
            </td>
            <td>{$vo.spot_name}</td>
            <td>{$vo.name}</td>
            <td>{$vo.sort}</td>
            <!--<td>{$vo.link}</td>-->
            <td>{$vo.create_time||date="Y-m-d H:i"}</td>
            <td class='text-center nowrap'>
                {if auth("$classuri/editAd")}
                <span class="text-explode">|</span>
                <a data-modal='{:url("$classuri/editAd")}?id={$vo.id}' href="javascript:void(0)">编辑</a>
                {/if}
                {if auth("$classuri/delAd")}
                <span class="text-explode">|</span>
                <a data-update="{$vo.id}" data-field='delete' data-action='{:url("$classuri/delAd")}' href="javascript:void(0)">删除</a>
                {/if}
            </td>
        </tr>
        {/foreach}
        {/if}
        </tbody>
    </table>
    {if isset($page)}<p>{$page}</p>{/if}
</form>
{/block}